<?php
 
  $user=$_POST["user"];
  $pass=$_POST["pass"];
  $member_type=$_POST["member_type"];
  
  
  $conn=mysql_connect("localhost","root","");
  
  mysql_select_db("tl2");
  $query = "select * from member where username='$user' ";
  $result= mysql_query($query);
  
  
  if (mysql_num_rows($result)>0)
  {
   echo "Username already exists";
  }
  else
  {
  $query="insert into member (username,password,type_id) values ('$user','$pass','$member_type')";
  $result=mysql_query($query);
  echo "Added in Database";
  }
?>
